#pragma once

#include <QWidget>
#include "ui_curveWidget.h"
#include "modelSoft.h"

QT_BEGIN_NAMESPACE
namespace Ui { class curveWidgetClass; };
QT_END_NAMESPACE

class curveWidget : public QWidget
{
	Q_OBJECT

public:
	curveWidget(modelSoft* myModelSoft, QWidget *parent = nullptr);
	~curveWidget();

protected:
	void receiveVertexPoint(gp_Pnt position);
	virtual void closeEvent(QCloseEvent* event) override;
	void OnConfirm();
	void OnModify();
	void OnSelVertex();
	void OnCancelSelVertex();
	void OnBoolOPChange(int index);
	void CreateConnections();
private:
	Ui::curveWidgetClass *ui;
	modelSoft* myModelSoft;
	//0:line 1:curve 2:Ellipse
	int type = 0;
	//记录选取点的数量
	int receiveVertexNum = 0;
	bool modifyStatus = false;
	bool confirmCreated = false;
	//暂存可视化选择点Actor
	std::vector<vtkSmartPointer<vtkActor>> vertexActors;

	Handle(QIVtkSelectionPipeline) resultPipeline;
	Handle(QIVtkSelectionPipeline) stretchPipeline;
	Standard_Real vertexPos[5][3];
};
